@extends('admin.mainlayout')
@section('title')
    <div class="title"><span>品牌管理(详情)></span></div>
    @endsection
    @section('content')
        <!-- 基本信息 -->
    <div class="three">
        <div class="tab">
            <p class="active"><a href="/center/brand/info?id={{$res['id']}}">基本信息</a></p>
            <p><a href="/center/brand/agent?id={{$res['id']}}">代理成员</a></p>
            <p><a href="/center/brand/order">交易统计</a></p>
        </div>
        <div class="body">
            <!--基本信息-->
            <form action="/center/brand/edit" method="post" enctype="multipart/form-data" id="form">
            <div class="left">
                <div class="one">
                    <p>品牌名称</p>
                    <input type="hidden" name="id" value="{{$res['id']}}">
                    <input type="text" name="title" value="{{$res['title']}}"/>
                </div>
                <div class="one">
                    <p>负责人</p>
                    <input type="text"  name="name" value="{{$res['name']}}"/>
                </div>
                <div class="one">
                    <p>联系方式</p>
                    <input type="text"  name="mobile" value="{{$res['mobile']}}"/>
                </div>
                <div class="one">
                    <p>地址</p>
                    <input type="text"  name="address" value="{{$res['address']}}"/>
                </div>
                <div class="two">
                    <p>营业执照</p>
                    <img src="" id="prev_img" alt=""/>
                    <span>点击上传图片 <input type="file" name="pics" id="doc-ipt-file-1"></span>
                </div>
                <div class="save" onclick="$('#form').submit()">保存</div>
            </div>
        </div>
    </div>
    <script>
        var message = "{{Session::get('message')}}";
        $(window).ready(function () {
            if (message) {
                layer.msg(message, {
                    time: 3000 //2秒关闭（如果不配置，默认是3秒）
                });
            }
        });
        window.onload = function() {
            var file = document.getElementById('doc-ipt-file-1');
            var img = document.getElementById('prev_img');
            file.onchange = function () {
                var oFReader = new FileReader();
                oFReader.readAsDataURL(this.files[0]);
                oFReader.onload = function (oFREvent) {
                    img.src = oFREvent.target.result;
                };
            }
        }
    </script>
@endsection
